package com.etc.entity;

import java.util.ArrayList;
import java.util.Date;

public class OrderInfo {
    private int id;//id
    private ArrayList<Product> productlist;//商品信息
    private int number;//总数量
    private double total;//总价
    private String time;//日期
    private Person person;//用户信息
	@Override
	public String toString() {
		return "OrderInfo [id=" + id + ", productlist=" + productlist + ", number=" + number + ", total=" + total
				+ ", time=" + time + ", person=" + person + "]";
	}
	public OrderInfo(int id, ArrayList<Product> productlist,  double total, String time, Person person) {
		super();
		this.id = id;
		this.productlist = productlist;
		this.number = number;
		this.total = total;
		this.time = time;
		this.person = person;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public ArrayList<Product> getProductlist() {
		return productlist;
	}
	public void setProductlist(ArrayList<Product> productlist) {
		this.productlist = productlist;
	}
	public int getNumber() {
		int num=0;
		for(int i=0;i<productlist.size();i++){
			num+=productlist.get(i).getNumber();
		}
		return num;
	}
	public void setNumber(int number) {
		this.number = number;
	}
	public double getTotal() {
		return total;
	}
	public void setTotal(double total) {
		this.total = total;
	}
	public String getTime() {
		return time;
	}
	public void setTime(String time) {
		this.time = time;
	}
	public Person getPerson() {
		return person;
	}
	public void setPerson(Person person) {
		this.person = person;
	}
    
}
